package com.example.administrator.xtu_community.utils;

import com.example.administrator.xtu_community.bean.Comment;
import com.example.administrator.xtu_community.bean.Note;
import com.example.administrator.xtu_community.bean.User;

import org.litepal.crud.DataSupport;

import java.util.List;

public class DataUtils {
    public static List<User> findAllUsers(){
        return DataSupport.findAll(User.class,true);
    }
    public static List<User> findAllNewses(){
        return DataSupport.findAll(User.class,true);
    }
    public static List<User> findAllNotes(){
        return DataSupport.findAll(User.class,true);
    }
    public static List<Comment> findAllComments(User user){
        return DataSupport.findAll(Comment.class);
    }
    public static List<Comment> findComments(User user){
        return user.getCommentList();
    }
    public static List<Comment> findComments(Note note){
        return note.getCommentList();
    }



}
